package com.stone.boot.file.app.service;

import com.stone.boot.file.domain.bo.OssCallbackResult;
import com.stone.boot.file.domain.bo.OssPolicyResult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * oss上传管理Service
 *
 * @author Mr_wenpan@163.com 2021/8/19 2:36 下午
 */
public interface OssService {
    /**
     * oss 上传生成策略
     *
     * @return
     */
    OssPolicyResult policy();

    /**
     * oss上传成功回调
     *
     * @param request
     * @return
     */
    OssCallbackResult callback(HttpServletRequest request);

    /**
     * 文件上传
     *
     * @param file
     * @param fileName
     * @return java.util.Map<java.lang.String, java.lang.Object>
     */
    Map<String, Object> upload(MultipartFile file, String fileName);
}
